import 'package:flutter/material.dart';

import '../../../res/myColors.dart';
import '../../../utils/utilScreen.dart';
import '../../../widgets/base_page/BaseStatefulPage.dart';
//支付记录
class PayRecordPage extends BaseStatefulPage {
  @override
  BaseStatefulPageState<BaseStatefulPage> createState() {
   return _PayRecordPageState();
  }

}
class _PayRecordPageState extends BaseStatefulPageState<PayRecordPage> {
  @override
  Widget buildPage(BuildContext context) {
    return Container(
      width: utilScreen.getScreenWidth(context),
      height: utilScreen.getScreenHeight(context),
      decoration: BoxDecoration(
        color: Colors.white,
       borderRadius: BorderRadius.only(
         topLeft: Radius.circular(5),
         topRight: Radius.circular(5),
       ),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
          SizedBox(height: 10,),
          Stack(
            children: [
              Align(
                alignment: Alignment.center,
                child: Text(
                  '支付记录',
                  style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
                ),
              ),
              Align(
                alignment: Alignment.centerRight,
                child: GestureDetector(
                  onTap: () => Navigator.of(context).pop(),
                  child: CircleAvatar(
                    radius: 14,
                    backgroundColor: Colors.grey[300],
                    child: Icon(Icons.close, size: 18, color: Colors.black),
                  ),
                ),
              ),
            ],
          ),
          Expanded(child: ListView.separated(
              itemBuilder: (context,index){
                return buildItem();
              },
              separatorBuilder: ( context,  index){
                return SizedBox(height: 10,);
              },
              itemCount: 10)
          ),
        ],
      )
    );
  }
  Widget buildItem(){
   return Column(
     crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        buildItemContent('支付时间', 'xxx'),
        buildItemContent('支付方式', 'xxx'),
        buildItemContent('金额', 'xxx'),
        buildItemContent('备注', 'xxx'),
      ],
    );
  }
  Widget buildItemContent(String title, String content) {
    return Container(
      margin: EdgeInsets.only(left: 15, right: 15, top: 5),
      child: Text(
        '${title}：${content}',
        style: TextStyle(fontSize: 14, color: myColors.c_707070),
      ),
    );
  }
}